package com.mjf.cjt.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * desc
 * </p>
 *
 * @author chenshoumeng
 * @date 2025/7/27 16:37
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TCjtzjbSaleDeliveryCreateVo {
    @JsonProperty("dto")
    private Dto dto;
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Dto {
        // 单据编码
        @JsonProperty("Code")
        private String Code;

        // 是否修改编号
        @JsonProperty("IsModifiedCode")
        private Boolean IsModifiedCode;

        // 单据日期
        @JsonProperty("VoucherDate")
        private String VoucherDate;

        // 外部系统单据编码
        @JsonProperty("ExternalCode")
        private String ExternalCode;

        // 业务类型
        @JsonProperty("BusinessType")
        private BusinessType BusinessType;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class BusinessType {
            @JsonProperty("Code")
            private String Code;
        }

        // 票据类型
        @JsonProperty("InvoiceType")
        private InvoiceType InvoiceType;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class InvoiceType {
            @JsonProperty("Code")
            private String Code;
        }

        // 客户
        @JsonProperty("Customer")
        private Customer Customer;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Customer {
            @JsonProperty("Code")
            private String Code;
        }

        //结算客户
        @JsonProperty("SettleCustomer")
        private SettleCustomer SettleCustomer;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class SettleCustomer {
            @JsonProperty("Code")
            private String Code;
        }

        // 仓库
        @JsonProperty("Warehouse")
        private Warehouse Warehouse;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Warehouse {
            @JsonProperty("Code")
            private String Code;

            @JsonProperty("Name")
            private String Name;
        }

        // 收货仓库编码
        @JsonProperty("ReceiveWarehouse")
        private ReceiveWarehouse ReceiveWarehouse;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class ReceiveWarehouse {
            @JsonProperty("Code")
            private String Code;
        }

        // 出库类别
        @JsonProperty("RdStyle")
        private RdStyle RdStyle;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class RdStyle {
            @JsonProperty("Code")
            private String Code;

            @JsonProperty("IsAutoGenerateSaleOut")
            private String IsAutoGenerateSaleOut;
        }

        // 部门
        @JsonProperty("Department")
        private Department Department;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Department {
            @JsonProperty("Code")
            private String Code;
        }

        // 特殊票种
        @JsonProperty("InvoiceSpecial")
        private InvoiceSpecial InvoiceSpecial;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class InvoiceSpecial {
            @JsonProperty("Code")
            private String Code;
        }

        // 营销机构
        @JsonProperty("MarketingOrgan")
        private MarketingOrgan MarketingOrgan;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class MarketingOrgan {
            @JsonProperty("Code")
            private String Code;
        }

        // 业务员信息
        @JsonProperty("Clerk")
        private Clerk Clerk;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Clerk {
            @JsonProperty("Code")
            private String Code;
        }

        // 项目
        @JsonProperty("Project")
        private Project Project;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Project {
            @JsonProperty("Code")
            private String Code;
        }

        // 币种
        @JsonProperty("Currency")
        private Currency Currency;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Currency {
            @JsonProperty("Code")
            private String Code;
            @JsonProperty("ExchangeRate")
            private String ExchangeRate;
            @JsonProperty("DeliveryDate")
            private String DeliveryDate;
            @JsonProperty("DeliveryMode")
            private String DeliveryMode;
        }

        // 收款方式
        @JsonProperty("ReciveType")
        private ReciveType ReciveType;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class ReciveType {
            @JsonProperty("Code")
            private String Code;
            @JsonProperty("RecivingMaturity")
            private String RecivingMaturity;
            @JsonProperty("DiscountRate")
            private String DiscountRate;
            @JsonProperty("OrigSettleAmount")
            private String OrigSettleAmount;
            @JsonProperty("OrigAllowances")
            private String OrigAllowances;
            @JsonProperty("IsPriceTrace")
            private String IsPriceTrace;
            @JsonProperty("IsAutoGenerateInvoice")
            private String IsAutoGenerateInvoice;
            @JsonProperty("IsSeparateByWareHouse")
            private String IsSeparateByWareHouse;
        }

        // 会员
        @JsonProperty("Member")
        private Member Member;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class Member {
            @JsonProperty("Code")
            private String Code;
            @JsonProperty("Address")
            private String Address;
            @JsonProperty("SendDate")
            private String SendDate;
            @JsonProperty("ThroughDate")
            private String ThroughDate;
            @JsonProperty("TransNumber")
            private String TransNumber;
            @JsonProperty("LinkMan")
            private String LinkMan;
            @JsonProperty("ContactPhone")
            private String ContactPhone;
            @JsonProperty("CustomerPhone")
            private String CustomerPhone;
            @JsonProperty("Memo")
            private String Memo;
            @JsonProperty("TransDocNo")
            private String TransDocNo;
            @JsonProperty("DeliveryCode")
            private String DeliveryCode;
            @JsonProperty("DeliveryVoucherDate")
            private String DeliveryVoucherDate;
        }

        // 物流网点信息
        @JsonProperty("LogisticsNetwork")
        private LogisticsNetwork LogisticsNetwork;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class LogisticsNetwork {
            @JsonProperty("Code")
            private String Code;
        }

        // 送货人（员工档案）
        @JsonProperty("SendPerson")
        private SendPerson SendPerson;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class SendPerson {
            @JsonProperty("Code")
            private String Code;
        }

        // 配送方式
        @JsonProperty("DistributionMode")
        private DistributionMode DistributionMode;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class DistributionMode {
            @JsonProperty("Code")
            private String Code;
            @JsonProperty("ReturnOrderReason")
            private String ReturnOrderReason;
        }

        @JsonProperty("DynamicPropertyKeys")
        private DynamicPropertyKeys DynamicPropertyKeys;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class DynamicPropertyKeys {
            @JsonProperty("pubuserdefdecm1")
            private String pubuserdefdecm1;

            @JsonProperty("pubuserdefdecm2")
            private String pubuserdefdecm2;

            @JsonProperty("pubuserdefdecm3")
            private String pubuserdefdecm3;

            @JsonProperty("pubuserdefdecm4")
            private String pubuserdefdecm4;

            @JsonProperty("pubuserdefdecm5")
            private String pubuserdefdecm5;

            @JsonProperty("pubuserdefnvc1")
            private String pubuserdefnvc1;

            @JsonProperty("pubuserdefnvc2")
            private String pubuserdefnvc2;

            @JsonProperty("pubuserdefnvc3")
            private String pubuserdefnvc3;

            @JsonProperty("pubuserdefnvc4")
            private String pubuserdefnvc4;

            @JsonProperty("pubuserdefnvc5")
            private String pubuserdefnvc5;

            @JsonProperty("priuserdefdecm1")
            private String priuserdefdecm1;

            @JsonProperty("priuserdefdecm2")
            private String priuserdefdecm2;

            @JsonProperty("priuserdefdecm3")
            private String priuserdefdecm3;

            @JsonProperty("priuserdefdecm4")
            private String priuserdefdecm4;

            @JsonProperty("priuserdefdecm5")
            private String priuserdefdecm5;

            @JsonProperty("priuserdefnvc1")
            private String priuserdefnvc1;

            @JsonProperty("priuserdefnvc2")
            private String priuserdefnvc2;

            @JsonProperty("priuserdefnvc3")
            private String priuserdefnvc3;

            @JsonProperty("priuserdefnvc4")
            private String priuserdefnvc4;

            @JsonProperty("priuserdefnvc5")
            private String priuserdefnvc5;

            @JsonProperty("DynamicPropertyValues")
            private String DynamicPropertyValues;

            @JsonProperty("OrigPreReceiveAmount")
            private String OrigPreReceiveAmount;

            @JsonProperty("PreReceiveAmount")
            private String PreReceiveAmount;

        }

        // 销货单明细
        @JsonProperty("SaleDeliveryDetails")
        private List<SaleDeliveryDetails> SaleDeliveryDetails;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        @Builder
        public static class SaleDeliveryDetails {

            // 仓库
            @JsonProperty("Warehouse")
            private Warehouse Warehouse;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class Warehouse {
                @JsonProperty("Code")
                private String Code;
            }

            // 项目
            @JsonProperty("Project")
            private Project Project;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class Project {
                @JsonProperty("Code")
                private String Code;
            }

            // 存货
            @JsonProperty("Inventory")
            private Inventory Inventory;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class Inventory {
                @JsonProperty("Code")
                private String Code;
                @JsonProperty("InventoryBarCode")
                private String InventoryBarCode;
            }

            // 计量单位
            @JsonProperty("Unit")
            private Unit Unit;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class Unit {
                @JsonProperty("Name")
                private String Name;
            }

            // 计量单位2
            @JsonProperty("Unit2")
            private Unit2 Unit2;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class Unit2 {
                @JsonProperty("Name2")
                private String Name2;
                @JsonProperty("UnitExchangeRate")
                private String UnitExchangeRate;
                @JsonProperty("Batch")
                private String Batch;
                @JsonProperty("ExpiryDate")
                private String ExpiryDate;
                @JsonProperty("ProductionDate")
                private String ProductionDate;
                @JsonProperty("Quantity")
                private String Quantity;
                @JsonProperty("OrigPrice")
                private String OrigPrice;
                @JsonProperty("DiscountRate")
                private String DiscountRate;
                @JsonProperty("OrigDiscountPrice")
                private String OrigDiscountPrice;
                @JsonProperty("TaxRate")
                private String TaxRate;
                @JsonProperty("OrigTaxAmount")
                private String OrigTaxAmount;
                @JsonProperty("TaxAmount")
                private String TaxAmount;
            }

            // 退补标志
            @JsonProperty("RefundDifferenceFlag")
            private RefundDifferenceFlag RefundDifferenceFlag;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class RefundDifferenceFlag {
                @JsonProperty("Code")
                private String Code;
                @JsonProperty("ReceiveVoucherCode")
                private String ReceiveVoucherCode;
                @JsonProperty("IsPresent")
                private String IsPresent;
                @JsonProperty("DeliveryDate")
                private String DeliveryDate;
                @JsonProperty("IsManualCost")
                private String IsManualCost;
                @JsonProperty("CostAmount")
                private String CostAmount;
                @JsonProperty("CostPrice")
                private String CostPrice;
            }

            // 明细行动态属性
            @JsonProperty("DynamicPropertyKeys")
            private DynamicPropertyKeys DynamicPropertyKeys;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            @Builder
            public static class DynamicPropertyKeys {
                @JsonProperty("pubuserdefdecm1")
                private String pubuserdefdecm1;
                @JsonProperty("pubuserdefdecm2")
                private String pubuserdefdecm2;
                @JsonProperty("pubuserdefdecm3")
                private String pubuserdefdecm3;
                @JsonProperty("pubuserdefdecm4")
                private String pubuserdefdecm4;
                @JsonProperty("pubuserdefdecm5")
                private String pubuserdefdecm5;
                @JsonProperty("pubuserdefnvc1")
                private String pubuserdefnvc1;
                @JsonProperty("pubuserdefnvc2")
                private String pubuserdefnvc2;

                @JsonProperty("pubuserdefnvc3")
                private String pubuserdefnvc3;
                @JsonProperty("pubuserdefnvc4")
                private String pubuserdefnvc4;
                @JsonProperty("pubuserdefnvc5")
                private String pubuserdefnvc5;
                @JsonProperty("priuserdefdecm1")
                private String priuserdefdecm1;
                @JsonProperty("priuserdefdecm2")
                private String priuserdefdecm2;
                @JsonProperty("priuserdefdecm3")
                private String priuserdefdecm3;
                @JsonProperty("priuserdefdecm4")
                private String priuserdefdecm4;
                @JsonProperty("priuserdefdecm5")
                private String priuserdefdecm5;
                @JsonProperty("priuserdefnvc1")
                private String priuserdefnvc1;
                @JsonProperty("priuserdefnvc2")
                private String priuserdefnvc2;
                @JsonProperty("priuserdefnvc3")
                private String priuserdefnvc3;
                @JsonProperty("priuserdefnvc4")
                private String priuserdefnvc4;
                @JsonProperty("priuserdefnvc5")
                private String priuserdefnvc5;
                @JsonProperty("DynamicPropertyValues")
                private String DynamicPropertyValues;
                @JsonProperty("ExpiryDate")
                private String ExpiryDate;
                @JsonProperty("DetailMemo")
                private String DetailMemo;
            }
        }
    }
}
